home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 33
/
033.d81
/
no-res hangman
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
13KB
|
489 lines
1 poke53280,7:poke53281,7:poke646,0:d3=1
2 printchr$(14)chr$(8)
3 dimht$(40):ht$(1)="":fori=2to40:ht$(i)=ht$(i-1)+"":next
4 ht$=chr$(145)+chr$(13)
5 dimvt$(25):vt$(0)="":fori=1to25:vt$(i)=vt$(i-1)+chr$(17):next
6 s=54272:forx=0to24:pokes+x,0:next:pokes+5,103:pokes+6,167:pokes+24,15
10 printchr$(147):goto 100
40 q=0:fa=0:sp=0:g=0
50 return
70 :
71 ht$=chr$(145)+chr$(13)
72 forpa=0to19:printvt$(1)ht$tab(19-pa)"*"vt$(1);
73 printht$tab(19+pa)"*";:next
74 forpa=1to22:printvt$(pa)ht$tab(0)"*"ht$tab(38)"*";
75 next
76 forpa=19to0step-1:printvt$(23)ht$tab(19-pa)"*";
77 printvt$(23)ht$tab(19+pa)"*";:next
78 printvt$(23);
80 :
82 return
90 forby=21to2step-1
95 printvt$(by)" "
97 next
99 return
100 :
110 dim w$(100),w(100),do$(26)
120 :
130 :
150 restore
180 fori=1to82:readw$(i):next
190 :
200 print"[147]"vt$(23);
210 fori=1to82
220 printw$(i)
230 next
235 printvt$(0)" "spc(37)" "
240 forpa=1to1500:next
250 gosub70
260 forpa=1to500:next
300 forby=21to2step-1
310 printvt$(by)" "
320 :
330 next
360 :
365 :
370 ifvq=1thenprint"[147]";:gosub70
373 vq=1
374 print"":printvt$(3)ht$tab(12)"[206]o-[210]es [200]angman"
375 printht$tab(12)"[163][163] [163][163][163] [163][163][163][163][163][163][163]"
380 printvt$(7)ht$tab(13): print "[215]hich set?"
390 printht$tab(49)"1. [210]egular list"
400 printht$tab(49)"2. [217]oung person's list"
410 printht$tab(49)"3. [208]hrase list"
415 printht$tab(49)"[211]. [211]ound effects-";:on d3 gosub453,458
420 printht$tab(49)"[209] -- [209]uit to [204]oadstar"
430 printvt$(20):printht$tab(13):print" [208]ick one: ";
440 poke198,.:wait198,1:getk$:ifk$="q"thenprint"[209]":goto10000
450 ifk$="s"thenifd3=1thend3=2:goto374
451 goto455
453 print"on[146] ":return
455 ifk$="s"thenifd3=2thend3=1:goto374
456 goto460
458 print"off[146]":return
460 ifval(k$)=.then440
470 k=val(k$):ifk>3then440
475 printk$
480 ifk$=w$(0)then570
490 w$(0)=k$:k$=""
500 open8,8,8,"t.hangtext."+w$(0)
520 input#8,w(0):fori=1tow(0)
530 input#8,w$(i):next
540 close8
550 fori=1tow(0):w(i)=i:next
560 fori=1tow(0):r1=int(rnd(1)*w(0))+1:t=w(r1):w(r1)=w(i):w(i)=t:next
570 gosub90
580 printvt$(10)ht$tab(8)"[210]emember, seven wrong"
590 printvt$(13)ht$tab(8)"guesses and you lose."
600 forpa=1to1500:next
630 forpa=1to40:next
640 :
650 :
660 printvt$(24);:print
670 foruu=1to23
680 print:ox=1:d=19-uu:gosub4000
690 :
700 next:pokes+4,16
710 if k$ < > "" then 730
720 w(0)=w(0)+1
730 gosub40
740 w(0)=w(0)-1
741 ifw(0)=0thenprintvt$(12);:print"[149][217]ou've used all the words in this list."
742 ifw(0)=0thenprint"[149][215]e'll now return you to the main menu."
743 ifw(0)=0thenforpa=1to2000:next:w$(0)="":vq=1:goto360
750 p$=w$(w(w(0)))
755 fori=1to26:do$(i)="":next
760 print"[147]":forda=1tolen(p$)
761 ps$=mid$(p$,da,1)
765 ifps$<"a"thenprintvt$(14);:printht$tab(((2*da)+(19-len(p$))));:printps$:goto790
770 printvt$(14);:printht$tab(((2 * da) + (19 - len (p$))));: print "[183]"
780 :
790 next
800 forda=1tolen(p$)
810 ifmid$(p$,da,1)<>" "then820
811 printvt$(14);
815 printht$tab(((2*da)+(20-len(p$))));: print " "
816 sp=sp+1
820 ifmid$(p$,da,1)<>"-"then830
821 printvt$(14);:printht$tab(((2*da)+(20-len(p$)));
825 print" ":printvt$(13);:printht$tab(((2*da)+( 20-len(p$)));
826 print"[183]":sp=sp+1
830 ifmid$(p$,da,1)<>"'"then840
831 printvt$(14)ht$tab(((2*da)+(20-len(p$)));
835 print" ":printvt$ (13)ht$tab(((2*da)+20-len(p$)));
836 print"'":sp=sp+1
840 ifmid$(p$,da,1)<>"@"then850
841 printvt$(14)ht$tab(((2*da)+(20-len(p$))));
842 print",":sp=sp+1
850 next
860 gosub 7080
870 printvt$(22)" "
880 forpa=1to100:next
890 :
900 :
910 printvt$(22)ht$tab(13)"[199]uess a letter"
920 poke198,0:wait198,1:getl1$:ifl1$<"a"orl1$>"z"then920
930 :
931 forv=17to23:printvt$(v)ht$tab(0);
932 print" ": next
940 l1=asc(l1$):l$=chr$(l1+128)
950 q=q+1
960 ifq=1then1060
970 forz=1toq-1
980 ifl$=do$(z)thenz=q:next:goto1010
990 next
1000 goto1060
1010 :
1020 printvt$(21);
1030 printht$tab(9)"[149][217]oo-hoo, [197]instein, you": printht$tab(6);
1040 print "guessed "l$" before. [212]ry again."
1050 goto 920
1060 forx=1tolen(p$)
1070 ifl$=mid$(p$,x,1)then1180
1080 next
1090 do$(q)=l$
1100 ifsub=1thensub=0:goto920
1110 printvt$(20);
1120 g=g+1
1130 forpa=1to300:nextpa
1140 gosub7000
1150 ifg=7then3400
1160 printvt$(22)ht$tab(12)"[215]rong. [212]ry again."
1170 goto920
1180 sp=sp+1
1190 fa=1
1200 gosub8000
1210 ifsp=len(p$)then3000
1220 sub=1
1230 goto1080
1240 forpa=1to40:next
3000 forv=20to23:printvt$(v)ht$tab(0)spc(38):next
3010 forpause=1to600:next
3020 ifg=0then3260
3030 ifg=1then3310
3040 printvt$(15)ht$tab(10)"[144] [207]kay, you won. [194]ut you"
3050 printvt$(17)ht$tab(12)"got wrong first!"
3060 printvt$(19)ht$tab(8)"[195]are to try another round?"
3070 printht$tab( 57)"([217]/[206])"
3072 print" "
3074 print" "
3080 forpa=1to40:next
3090 ox=1:foryup=1tog
3100 forpa=1to60:next
3110 :
3120 printvt$(17)ht$tab(15)chr$(18);yup;:d=yup*2:gosub4000
3130 next:pokes+4,16
3140 printvt$(17)ht$tab(15)g;
3150 :
3160 poke198,0:wait198,1:getag$:ifag$<>"y"andag$<>"n"then3160
3165 :
3170 wi=int(rnd(1)*6)+1
3180 ifwi=p1orwi=p2orwi=p3then3170
3190 p3=p2:p2=p1:p1=wi
3200 on wi gosub 5000,5130,5260,5360,5470,5570
3220 ifag$="y"then3240
3230 goto360
3240 forwp=0to26:do$(wp)="":next
3250 goto730
3260 forv=20to23:printvt$(v)ht$tab(0);
3265 print" ": next
3268 printvt$(16)ht$tab(5)"[156][193] perfect game! [201]'m impressed!"
3269 ford=23to-6step-1:ox=1:gosub4000:next:pokes+4,16:forpa=1to300:next
3270 printht$tab(6)"[201] bet you can't do it again."
3275 forpa=1to1000:next
3280 print : printht$tab(4)"[210]eady to give me another chance?"
3290 printht$tab( 57)"([217]/[206])"
3300 goto 3150
3310 printvt$(15)ht$tab( 8)"[207]nly one wrong. [206]ot bad..."
3320 ford= 23to-6step-1:ox=1:gosub4000:next:pokes+4,16:forpa=1to800:next
3330 print : printht$tab(14)"[198]or a human."
3340 forpa=1to600:next
3350 print : printht$tab( 6)"[212]he next round shall be mine."
3360 forpa=1to300:next:print
3370 printht$tab( 6)"[193]re you prepared to continue?"
3380 printht$tab(57): print "([217]/[206])"
3390 goto 3150
3400 forv=20to23:printvt$(v);:printht$tab(0);
3405 print" ": next
3410 forpa=1to300:next
3420 iffa=0then3560
3430 printvt$(15)ht$tab(2)"[211]orry, but you've run out of guesses."
3440 ford=-6to23:ox=1:gosub4000:next:pokes+4,16:forpa=1to300:next
3450 print:printht$tab(8)"[200]ere's the entire word..."
3460 forpa=1to300:next
3470 forbit=1tolen(p$)
3480 :
3490 printvt$(13)ht$tab(((2*bit)+(19-len(p$))))""mid$(p$,bit,1)
3500 ox=1:d=25-bit*2:gosub4000:forpa=1to50:next
3503 printvt$(13)ht$tab(((2*bit)+(19-len(p$))))mid$(p$,bit,1)
3505 next:pokes+4,16
3510 forpause=1to1300:next
3520 iffa=0then3610
3530 printvt$(19)ht$tab(7)"[195]are to revenge your death?"
3540 printht$tab(58)"([217]/[206])"
3550 goto3150
3560 printvt$(15)ht$tab(3)"[215]ow! [206]ot even one right! [193]re you"
3570 print " sure you've plaved this game before?"
3580 ford=-6to23:ox=1:gosub4000:next:pokes+4,16:forpa=1to1000:next
3590 print:print " [193]nyway, here's what you didn't get..."
3600 goto3460
3610 forv=15to19:printvt$(v)ht$tab(0);
3615 print" ": next
3620 printvt$(15)" [204]ook, [201] know this probably isn't"
3630 print " a good time, what with you losing"
3640 print " so bad, but [201] was wondering if"
3650 print " you'd like to play again...?"
3660 goto 3540
4000 ifd3=2thenreturn
4001 d2=24-d
4005 ifox<>1 then4060
4006 ox=0
4050 pokes+4,17
4060 pokes+1,d2
4070 pokes+1,d2*4
4075 ifd<>18thenreturn
4080 pokes+4,16
4090 return
5000 :
5110 print"[147]";
5120 return
5130 :
5140 ford1=0to12
5150 iv$=chr$(18)
5160 gosub5210
5170 iv$=""
5180 gosub5210
5190 next
5200 return
5210 printvt$(d1)iv$" "
5230 printvt$(23-d1)iv$" "
5250 return
5260 :
5270 fori1=0to30step10
5280 fori=1to23
5290 s1$=" ":ifi1=30thens